package com.shopmall.goods.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shopmall.goods.dao.LoginMapper;
import com.shopmall.goods.entity.Login;
import com.shopmall.goods.service.LoginService;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl extends ServiceImpl<LoginMapper,Login> implements LoginService {

    @Override
    public Login login(String phone) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("phone",phone);
        return baseMapper.selectOne(queryWrapper);
    }

    @Override
    public int addLogin(Login login) {
        return baseMapper.insert(login);
    }
}
